import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        //动态规划：dp[i]表示n的阶乘的值的后9位数
        String[] dp = new String[2];
        dp[0] = "1";
        int len = 0;
        long i = 2L;
        long iterations = 202320232023L;
        while (i <= iterations) {
            dp[(int) ((i - 1) & 1)] = String.valueOf(Integer.valueOf(dp[(int) ((i-2) & 1)]) * i + Integer.valueOf(dp[(int) ((i-2) & 1)]));
            len = dp[(int) ((i-1) & 1)].length();
            if (len > 9) dp[(int) ((i-1) & 1)] = dp[(int) ((i-1) & 1)].substring(len - 9,len);
            i++;

        }
        System.out.println(dp[(int)((iterations - 1) & 1)]);
        scan.close();
    }
}
